package com.battle.service.controller.web;

import com.battle.pojo.param.feedBack.*;
import com.battle.pojo.vo.feedBack.*;
import com.battle.service.service.in.*;
import nirvana.core.domains.vo.PageResult;
import nirvana.core.domains.vo.ApiResult;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;

import java.util.List;

/**
 * web/战例反馈
 * 【描 述】：
 * 【环 境】：J2SE
 * 【详 细】：
 */
@RestController
@RequestMapping("/feedBack/web")
public class FeedBackWebController {

    private final FeedBackService service;

    public FeedBackWebController(FeedBackService service) {
        this.service = service;
    }


    /**
     * 创建战例反馈
     *
     * @param param
     * @return
     */
    @PostMapping("/createFeedBack")
    public ApiResult createFeedBack(@RequestBody @Valid CreateFeedBackParam param) {
        service.createFeedBack(param);
        return ApiResult.ok();
    }


    /**
     * 获取战例反馈列表
     *
     * @param param
     * @return
     */
    @PostMapping("/getFeedBackList")
    public ApiResult<PageResult<GetFeedBackListVo>> getFeedBackList(@RequestBody GetFeedBackListParam param) {
        PageResult<GetFeedBackListVo> result = service.getFeedBackList(param);
        return ApiResult.ok(result);
    }



}

